<template>
    <view class="head"
      style="background-color: #ffcc00;
      height: 180rpx;
      display: flex;">
      <img
        style="height: 50rpx;
        width: 50rpx;
        padding: 10rpx;
        margin-top: 15%;"  
        src="../../../../../static/tabbar/返回.png" alt="" @click="handleBack">
      </img>
      <view style="
        height: fit-content;
        margin-top: 15%;
        margin-left: 30%;
        font-size: 32rpx;"
      >详细预约</view> <!-- 显示所选日期 -->
    </view>
    <view>
        
    </view>
  </template>
  
  <script setup>
  import { ref, onMounted } from 'vue';
  import { onLoad } from '@dcloudio/uni-app';
  
  const selectedDate = ref('');
  
  // 处理返回按钮点击事件
  const handleBack = () => {
    uni.navigateTo({ url: "/pages/customer-platform/index/menu/homeClean/homeClean" })
  };
  
  // 监听页面加载，获取并解析 URL 参数
  onLoad((options) => {
    console.log('接收到的 options:', options); // 调试输出
    if (options.date) {
      try {
        selectedDate.value = decodeURIComponent(options.date);
        console.log('解码后的日期:', selectedDate.value); // 调试输出
      } catch (err) {
        console.error('解码失败:', err);
        selectedDate.value = '日期解析失败';
      }
    } else {
      selectedDate.value = '未选择日期'; // 或者其他默认值
    }
  });
  </script>

<style>
</style>